package com.huarui.saleOrder.dao;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import com.huarui.purchaseOrder.model.PurOrSaleOrderDetail;

public interface ISaleOrderDetailsDao {
	/**
	 * 查询该销售订单所有明细
	 * @param paramsMap
	 * @return
	 */
	public List<Map<String, Object>> loadDetailsByOrdersId(Map<String, Object> paramsMap);
	
	/**
	 * 批量插入明细
	 * @param list
	 * @return
	 */
	public Integer batchInsert(final List<PurOrSaleOrderDetail> list);
	
	/**
	 * 查询该销售订单所有明细ID
	 * @param saleOrderId
	 * @return
	 */
	public List<Integer> getDetailsIdByOrderId(Integer saleOrderId);
	
	/**
	 * 批量删除明细
	 * @param ids
	 * @return
	 */
	public Integer deleteBatch(List<Integer> ids);
	
	/**
	 * 批量修改明细
	 * @param list
	 * @return
	 */
	public Integer updateBatch(final List<PurOrSaleOrderDetail> list);
	
	/**
	 * 计算明细总金额
	 * @param saleOrderId
	 * @return
	 */
	public BigDecimal getAmountByOrdersId(Integer saleOrderId);
	
	/**
	 * 删除该销售订单所有明细
	 * @param ordersId
	 * @return
	 */
	public Integer deleteDetailsByOrdersId(Integer ordersId);
	
	/**
	 * 明细浏览查询
	 * @param paramsMap
	 * @return
	 */
	public List<Map<String, Object>> querySaleDetailsListByComplex(Map<String, Object> paramsMap);
	
	/**
	 * 明细浏览总数量查询
	 * @param paramsMap
	 * @return
	 */
	public Integer querySaleDetailsListCountByComplex(Map<String, Object> paramsMap);

	public List<Map<String, Object>> getSaleOrderDetailByOrderId(Integer orderId);

	@SuppressWarnings("unchecked")
	public void batchUpdateSaleOrderPickedQty(List<Map> orderMap);
	
}
